package org.koyad.portal.tags.piston;

import org.koyad.portal.annotations.TagCordinates;
import org.koyad.portal.constants.FrameworkConstants;
import org.koyad.portal.context.PistonContext;
import org.koyad.portal.tags.AbstractTag;
import org.koyad.portal.tags.Attribute;
import org.koyad.portal.utils.LogUtils;

@TagCordinates (
	uri = FrameworkConstants.PORTAL_NAMESPACE,
	localName = "pageFragment"
)
public class PageFragmentTag extends AbstractTag {
	
	private static final LogUtils LOGGER = LogUtils.getLogger(PageFragmentTag.class);
	
	@Override
	public void postInit() {
		String currentTileId = PistonContext.getContext().getViewRoot().getCurrentTileId();
		if(null != currentTileId) {
			Attribute att = new Attribute(FrameworkConstants.PISTON_TILE_ID, currentTileId);
			_atts.add(att);
		}
	}

	@Override
	public void render() {
		super.renderBody();
	}
}
